/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.feiyue.basic.reader;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.WindowManager;
import android.widget.RelativeLayout;
import com.feiyue.MainTabActivity;
import com.feiyue.R;
import com.feiyue.basic.server.db.NovelDB;

public class LoadingActivity extends Activity {
	public static int rate;
	private Context context;
	public RelativeLayout layout;

	protected void go() {
		startActivity(new Intent(this.context, MainTabActivity.class));
		overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
		finish();
	}

	protected void onCreate(Bundle paramBundle) {
		super.onCreate(paramBundle);
		this.context = getApplicationContext();
		setContentView(R.layout.loading);
		this.layout = ((RelativeLayout) findViewById(R.id.loading));
		new Handler().postDelayed(new Runnable() {
			public void run() {
				LoadingActivity.this.go();
			}
		}, 1500L);
		NovelDB.copyDatabaseFile(getApplicationContext());
		DisplayMetrics localDisplayMetrics = new DisplayMetrics();
		getWindowManager().getDefaultDisplay().getMetrics(localDisplayMetrics);
		rate = (int) (localDisplayMetrics.widthPixels / 480.0F);
	}

	protected void onDestroy() {
		super.onDestroy();
		this.layout.setBackgroundDrawable(null);
	}
}